package com.da.javatest.interview.basic.statics;

public class Demo {
    static int a;
    int b;
    static int d;

    public void method(String str) {
        int c = 1;
        int d = 1;
        a++;
        b++;
        c++;
        d++;

        System.out.println(str);
        System.out.println("静态变量a = " + a);
        System.out.println("实例变量b = " + b);
        System.out.println("局部变量c = " + c);
        System.out.println("局部变量d = " + d);
    }

    public static void main(String[] args) {
        Demo d1 = new Demo();
        d1.method("d1.method()：");
        d1.method("d1.method()：");

        Demo d2 = new Demo();
        d2.method("d2.method()：");
    }
}